From 1540acce4df3dbc9d580798de722f743258c07dc Mon Sep 17 00:00:00 2001
From: James Alan Preiss <jamesalanpreiss@gmail.com>
Date: Thu, 14 Nov 2019 11:58:32 -0800
Subject: [PATCH] symmetry in vadd4

---
 math3d.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/math3d.h b/math3d.h
index ef6bd94..465f7f5 100644
--- a/math3d.h
+++ b/math3d.h
@@ -227,7 +227,7 @@ static inline struct vec vadd3(struct vec a, struct vec b, struct vec c) {
 // add 4 vectors.
 static inline struct vec vadd4(struct vec a, struct vec b, struct vec c, struct vec d) {
 	// TODO: make sure it compiles to optimal code
-	return vadd(vadd(vadd(a, b), c), d);
+	return vadd(vadd(a, b), vadd(c, d));
 }
 // subtract b and c from a.
 static inline struct vec vsub2(struct vec a, struct vec b, struct vec c) {
-- 
2.20.1